package com.lge.clock.worldclock.util;

import com.lge.clock.worldclock.cities.CityInformation;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @author lge.com
 */
public class DatabaseHelper extends SQLiteOpenHelper {
	
	//                          <<< History of WorldClock.db >>>
	// Ver. 1  --> For GB medels, U0 Open, Rogers, Orange
	// Ver. 2  --> For Cosmo GB
	// Ver. 3  --> For ICS Models
	//         [2012.04.12] added FOTA Upgrade code
	//         [2012.04.17] updated city name for Arab, Farsi, Thai
	//         [2012.04.18] modified Kiev's DST
	//         [2012.04.20] changed city name Irian jaya to Papua
	//         [2012.04.20] changed city name Tuman, Birobidgan to Tyumen , Birobidzhan
	//         [2012.04.23] changed Niamey's country name France to Niger in Japanese
	//         [2012.04.27] changed token translation for Houston in Thai
	//         [2012.04.30] added columns for es_AR
	//         [2012.05.07] changed city name Puerto Nuevo to Porto novo
	//         [2012.05.14] Japanese character is displayed in Thai language setting, so changed DB
	//         [2012.05.16] changed city name 'Buenos Aires' to 'Ciudad de Bs As' for es and es_AR
	// Ver. 4  [2012.05.22] changed city name Phnum Penh to Phnom Penh & Vatican City to Vatican in Korean
	//         [2012.05.22] translated Papua for Arabic/Farsi
	//         [2012.05.25] changed city name Azores to Portugal & add translated Hebrew token.
	//         [2012.05.25] translated city name in Hebrew
	// Ver. 5  [2012.06.07] added columns for kk & uk
	
	private static final int DTATBASE_VERSION = 5;
	
	public static final String PROVIDER_DATABASE_NAME = "Provider_WorldClock.db";
    public static final String PROVIDER_DATABASE_TABLE_NAME = "PROVIDER_WORLD_CLOCK";
    
	public static final String DATABASE_NAME = "WorldClock.db";
    
    public static final String DATABASE_TABLE_NAME = "WORLD_CLOCK";
    public static final String DATABASE_COLUMN_ID = "_id";
    public static final String DATABASE_COLUMN_CHOSEONG_CITY = "city_choseong";
    public static final String DATABASE_COLUMN_CHOSEONG_COUNTRY = "country_choseong";
    public static final String DATABASE_COLUMN_GMT_TEXT = "gmt_string";
    public static final String DATABASE_COLUMN_GMT_VALUE = "gmt_value";
    public static final String DATABASE_COLUMN_LATITUDE = "latitude";
    public static final String DATABASE_COLUMN_LONGITUDE = "longitude";
    public static final String DATABASE_COLUMN_DISPLAY_LEVEL = "display_level";
    public static final String DATABASE_COLUMN_LABEL_POSITION = "label_position";
    public static final String DATABASE_COLUMN_DAYLIGHT = "daylight";
    public static final String DATABASE_COLUMN_REQUEST = "request";
    public static final String DATABASE_COLUMN_SETTED = "set_info";
    public static final String DATABASE_COLUMN_SETTED_TIME = "set_time";

    public static final String DATABASE_COLUMN_COUNTRY_EN = "country_en";
    public static final String DATABASE_COLUMN_CITY_EN = "city_en";
    public static final String DATABASE_COLUMN_COUNTRY_KO = "country_ko";
    public static final String DATABASE_COLUMN_CITY_KO = "city_ko";
    public static final String DATABASE_COLUMN_COUNTRY_BG = "country_bg";
    public static final String DATABASE_COLUMN_CITY_BG = "city_bg";
    public static final String DATABASE_COLUMN_COUNTRY_HR = "country_hr";
    public static final String DATABASE_COLUMN_CITY_HR = "city_hr";
    public static final String DATABASE_COLUMN_COUNTRY_CS = "country_cs";
    public static final String DATABASE_COLUMN_CITY_CS = "city_cs";
    public static final String DATABASE_COLUMN_COUNTRY_DA = "country_da";
    public static final String DATABASE_COLUMN_CITY_DA = "city_da";
    public static final String DATABASE_COLUMN_COUNTRY_NL = "country_nl";
    public static final String DATABASE_COLUMN_CITY_NL = "city_nl";
    public static final String DATABASE_COLUMN_COUNTRY_NL_BE = "country_nl_BE";
    public static final String DATABASE_COLUMN_CITY_NL_BE = "city_nl_BE";
    public static final String DATABASE_COLUMN_COUNTRY_FI = "country_fi";
    public static final String DATABASE_COLUMN_CITY_FI = "city_fi";
    public static final String DATABASE_COLUMN_COUNTRY_FR = "country_fr";
    public static final String DATABASE_COLUMN_CITY_FR = "city_fr";
    public static final String DATABASE_COLUMN_COUNTRY_FR_BE = "country_fr_BE";
    public static final String DATABASE_COLUMN_CITY_FR_BE = "city_fr_BE";
    public static final String DATABASE_COLUMN_COUNTRY_FR_CH = "country_fr_CH";
    public static final String DATABASE_COLUMN_CITY_FR_CH = "city_fr_CH";
    public static final String DATABASE_COLUMN_COUNTRY_DE = "country_de";
    public static final String DATABASE_COLUMN_CITY_DE = "city_de";
    public static final String DATABASE_COLUMN_COUNTRY_DE_CH = "country_de_CH";
    public static final String DATABASE_COLUMN_CITY_DE_CH = "city_de_CH";
    public static final String DATABASE_COLUMN_COUNTRY_EL = "country_el";
    public static final String DATABASE_COLUMN_CITY_EL = "city_el";
    public static final String DATABASE_COLUMN_COUNTRY_HU = "country_hu";
    public static final String DATABASE_COLUMN_CITY_HU = "city_hu";
    public static final String DATABASE_COLUMN_COUNTRY_IS = "country_is";
    public static final String DATABASE_COLUMN_CITY_IS = "city_is";
    public static final String DATABASE_COLUMN_COUNTRY_IT = "country_it";
    public static final String DATABASE_COLUMN_CITY_IT = "city_it";
    public static final String DATABASE_COLUMN_COUNTRY_IT_CH = "country_it_CH";
    public static final String DATABASE_COLUMN_CITY_IT_CH = "city_it_CH";
    public static final String DATABASE_COLUMN_COUNTRY_MK = "country_mk";
    public static final String DATABASE_COLUMN_CITY_MK = "city_mk";
    public static final String DATABASE_COLUMN_COUNTRY_NO = "country_no";
    public static final String DATABASE_COLUMN_CITY_NO = "city_no";
    public static final String DATABASE_COLUMN_COUNTRY_PL = "country_pl";
    public static final String DATABASE_COLUMN_CITY_PL = "city_pl";
    public static final String DATABASE_COLUMN_COUNTRY_PT = "country_pt";
    public static final String DATABASE_COLUMN_CITY_PT = "city_pt";
    public static final String DATABASE_COLUMN_COUNTRY_RO = "country_ro";
    public static final String DATABASE_COLUMN_CITY_RO = "city_ro";
    public static final String DATABASE_COLUMN_COUNTRY_SR = "country_sr";
    public static final String DATABASE_COLUMN_CITY_SR = "city_sr";
    public static final String DATABASE_COLUMN_COUNTRY_SK = "country_sk";
    public static final String DATABASE_COLUMN_CITY_SK = "city_sk";
    public static final String DATABASE_COLUMN_COUNTRY_SL = "country_sl";
    public static final String DATABASE_COLUMN_CITY_SL = "city_sl";
    public static final String DATABASE_COLUMN_COUNTRY_ES = "country_es";
    public static final String DATABASE_COLUMN_CITY_ES = "city_es";
    public static final String DATABASE_COLUMN_COUNTRY_SV = "country_sv";
    public static final String DATABASE_COLUMN_CITY_SV = "city_sv";
    public static final String DATABASE_COLUMN_COUNTRY_TR = "country_tr";
    public static final String DATABASE_COLUMN_CITY_TR = "city_tr";
    public static final String DATABASE_COLUMN_COUNTRY_RU = "country_ru";
    public static final String DATABASE_COLUMN_CITY_RU = "city_ru";
    public static final String DATABASE_COLUMN_COUNTRY_RU_RIL = "country_ru_rIL";
    public static final String DATABASE_COLUMN_CITY_RU_RIL = "city_ru_rIL";
    public static final String DATABASE_COLUMN_COUNTRY_AR = "country_ar";
    public static final String DATABASE_COLUMN_CITY_AR = "city_ar";
    public static final String DATABASE_COLUMN_COUNTRY_IW = "country_iw";
    public static final String DATABASE_COLUMN_CITY_IW = "city_iw";
    public static final String DATABASE_COLUMN_COUNTRY_ZH_CN = "country_zh_CN";
    public static final String DATABASE_COLUMN_CITY_ZH_CN = "city_zh_CN";
    public static final String DATABASE_COLUMN_COUNTRY_ZH_TW = "country_zh_TW";
    public static final String DATABASE_COLUMN_CITY_ZH_TW = "city_zh_TW";
    public static final String DATABASE_COLUMN_COUNTRY_PT_BR = "country_pt_BR";
    public static final String DATABASE_COLUMN_CITY_PT_BR = "city_pt_BR";
    public static final String DATABASE_COLUMN_COUNTRY_ES_RMX = "country_es_rMX";
    public static final String DATABASE_COLUMN_CITY_ES_RMX = "city_es_rMX";
    public static final String DATABASE_COLUMN_COUNTRY_FR_CA = "country_fr_CA";
    public static final String DATABASE_COLUMN_CITY_FR_CA = "city_fr_CA";
    public static final String DATABASE_COLUMN_COUNTRY_EN_US = "country_en_US";
    public static final String DATABASE_COLUMN_CITY_EN_US = "city_en_US";
    public static final String DATABASE_COLUMN_COUNTRY_EN_AU = "country_en_AU";
    public static final String DATABASE_COLUMN_CITY_EN_AU = "city_en_AU";
    public static final String DATABASE_COLUMN_COUNTRY_EN_CA = "country_en_CA";
    public static final String DATABASE_COLUMN_CITY_EN_CA = "city_en_CA";
    public static final String DATABASE_COLUMN_COUNTRY_EN_IE = "country_en_IE";
    public static final String DATABASE_COLUMN_CITY_EN_IE = "city_en_IE";
    public static final String DATABASE_COLUMN_COUNTRY_ZH_HK = "country_zh_HK";
    public static final String DATABASE_COLUMN_CITY_ZH_HK = "city_zh_HK";
    public static final String DATABASE_COLUMN_COUNTRY_MS = "country_ms";
    public static final String DATABASE_COLUMN_CITY_MS = "city_ms";
    public static final String DATABASE_COLUMN_COUNTRY_ID = "country_id";
    public static final String DATABASE_COLUMN_CITY_ID = "city_id";
    public static final String DATABASE_COLUMN_COUNTRY_TH = "country_th";
    public static final String DATABASE_COLUMN_CITY_TH = "city_th";
    public static final String DATABASE_COLUMN_COUNTRY_VI = "country_vi";
    public static final String DATABASE_COLUMN_CITY_VI = "city_vi";
    public static final String DATABASE_COLUMN_COUNTRY_FA = "country_fa";
    public static final String DATABASE_COLUMN_CITY_FA = "city_fa";
    public static final String DATABASE_COLUMN_COUNTRY_JA = "country_ja";
    public static final String DATABASE_COLUMN_CITY_JA = "city_ja";
    public static final String DATABASE_COLUMN_COUNTRY_ES_AR = "country_es_AR";  //[suhaeng.lee] add language es_AR for VIVO
    public static final String DATABASE_COLUMN_CITY_ES_AR = "city_es_AR";
    public static final String DATABASE_COLUMN_COUNTRY_KK = "country_kk";
    public static final String DATABASE_COLUMN_CITY_KK = "city_kk";
    public static final String DATABASE_COLUMN_COUNTRY_UK = "country_uk";
    public static final String DATABASE_COLUMN_CITY_UK = "city_uk";
    
    public static final String DATABASE_COLUMN_UPDATE_MODE = "update_mode";
    
	public static String database_column_city = DATABASE_COLUMN_CITY_EN;
	public static String database_column_country = DATABASE_COLUMN_COUNTRY_EN;
	
	public static String database_column_city_en = DATABASE_COLUMN_CITY_EN;
	public static String database_column_country_en = DATABASE_COLUMN_COUNTRY_EN;

	private static final String DATABASE_COLUMN_CITY_PREFIX = "city_";
	private static final String DATABASE_COLUMN_COUNTRY_PREFIX = "country_";
	
    private String dbName = null;

    public static int getDataBaseVer() {
    	return DTATBASE_VERSION;
    }

    public DatabaseHelper(Context context, String name) {
    	super(context, name, null, DTATBASE_VERSION);
    	dbName = name;
    	database_column_city = DATABASE_COLUMN_CITY_PREFIX + CityInformation.getCurrentLocale();
    	database_column_country = DATABASE_COLUMN_COUNTRY_PREFIX + CityInformation.getCurrentLocale();
    }
    
    
    public void onCreate(SQLiteDatabase db) {
    	if(dbName.equals(PROVIDER_DATABASE_NAME)) {
    		db.execSQL("CREATE TABLE " + PROVIDER_DATABASE_TABLE_NAME + " ("
    				+ DATABASE_COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
    				+ DATABASE_COLUMN_COUNTRY_EN + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_KO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CHOSEONG_COUNTRY + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EN + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_KO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CHOSEONG_CITY + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_GMT_TEXT + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_GMT_VALUE + " INTEGER NOT NULL, "
    				+ DATABASE_COLUMN_LATITUDE + " TEXT NOT NULL,"
    				+ DATABASE_COLUMN_LONGITUDE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_DISPLAY_LEVEL + " INTEGER DEFAULT 0, "
    				+ DATABASE_COLUMN_LABEL_POSITION + " INTEGER DEFAULT 1, "
    				+ DATABASE_COLUMN_DAYLIGHT + " INTEGER DEFAULT 0, "
    				+ DATABASE_COLUMN_REQUEST + " TEXT DEFAULT NULL, "
    				+ DATABASE_COLUMN_SETTED + " INTEGER DEFAULT 0, "
    				+ DATABASE_COLUMN_SETTED_TIME + " INTEGER DEFAULT 0, "
    				+ DATABASE_COLUMN_COUNTRY_BG + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_BG + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_HR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_HR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_CS + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_CS + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_DA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_DA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_NL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_NL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_NL_BE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_NL_BE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FI + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FI + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FR_BE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FR_BE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FR_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FR_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_DE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_DE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_DE_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_DE_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_EL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_HU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_HU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_IS + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_IS + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_IT + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_IT + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_IT_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_IT_CH + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_MK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_MK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_NO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_NO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_PL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_PL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_PT + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_PT + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_RO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_RO + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_SR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_SR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_SK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_SK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_SL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_SL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ES + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ES + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_SV + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_SV + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_TR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_TR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_RU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_RU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_RU_RIL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_RU_RIL + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_AR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_AR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_IW + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_IW + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ZH_CN + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ZH_CN + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ZH_TW + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ZH_TW + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_PT_BR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_PT_BR + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ES_RMX + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ES_RMX + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FR_CA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FR_CA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_EN_US + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EN_US + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_EN_AU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EN_AU + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_EN_CA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EN_CA + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_EN_IE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_EN_IE + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ZH_HK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ZH_HK + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_MS  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_MS  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ID  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_ID  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_TH  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_TH  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_VI  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_VI  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_FA  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_FA  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_JA  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_JA  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_ES_AR  + " TEXT NOT NULL, "  //[suhaeng.lee] add language es_AR for VIVO
    				+ DATABASE_COLUMN_CITY_ES_AR  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_KK  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_KK  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_COUNTRY_UK  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_CITY_UK  + " TEXT NOT NULL, "
    				+ DATABASE_COLUMN_UPDATE_MODE + " INTEGER DEFAULT 0 "
    				+");");
    	}
    }

    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }

    public void recreateProviderTable (SQLiteDatabase db) {
    	if(db == null) {
    		return;
    	}
//    	android.util.Log.i("DatabaseHelper", "recreateProviderTable is called. DB Name is " + dbName);
   		db.execSQL("DROP TABLE IF EXISTS " + PROVIDER_DATABASE_TABLE_NAME);
       	onCreate(db);
    }  
    
}
